/// <summary>** BEGIN LICENSE BLOCK *****
/// Version: LGPL 3
/// 
/// Copyright 2008 David Cumps <david@cumps.be>
/// 
/// This file is part of ArmoryLib2.
///
/// ArmoryLib is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License as published by
/// the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// ArmoryLib is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with ArmoryLib2.  If not, see <http://www.gnu.org/licenses/>.
/// **** END LICENSE BLOCK ****
/// </summary>
using System;

using ArmoryLib2.Character.SpellDetail;

namespace ArmoryLib2.Character
{
    // <bonusHealing value="1053"/>
    // <penetration value="0"/>
    public class Spell
    {
        private Arcane _arcane;
        public Arcane Arcane
        {
            get { return _arcane; }
            private set { _arcane = value; }
        }

        private Fire _fire;
        public Fire Fire
        {
            get { return _fire; }
            private set { _fire = value; }
        }

        private Frost _frost;
        public Frost Frost
        {
            get { return _frost; }
            private set { _frost = value; }
        }

        private Holy _holy;
        public Holy Holy
        {
            get { return _holy; }
            private set { _holy = value; }
        }

        private Nature _nature;
        public Nature Nature
        {
            get { return _nature; }
            private set { _nature = value; }
        }

        private Shadow _shadow;
        public Shadow Shadow
        {
            get { return _shadow; }
            private set { _shadow = value; }
        }

        private int _bonusHealing;
        public int BonusHealing
        {
            get { return _bonusHealing; }
            private set { _bonusHealing = value; }
        }

        private ManaRegen _manaRegen;
        public ManaRegen ManaRegen
        {
            get { return _manaRegen; }
            private set { _manaRegen = value; }
        }

        private Hit _hit;
        public Hit Hit
        {
            get { return _hit; }
            private set { _hit = value; }
        }

        private Haste _haste;
        public Haste Haste
        {
            get { return _haste; }
            private set { _haste = value;}
        }
        private int _spellPenetration;
        public int SpellPenetration
        {
            get { return _spellPenetration; }
            private set { _spellPenetration = value; }
        }



        private PetBonus _petBonus;
        public PetBonus PetBonus
        {
            get { return _petBonus; }
            private set { _petBonus = value; }
        }

        internal Spell(Arcane arcane,
                       Fire fire,
                       Frost frost,
                       Holy holy,
                       Nature nature,
                       Shadow shadow,
                       ManaRegen manaRegen,
                       Hit hit,
                       Haste haste,
                       int bonusHealing,
                       int spellPenetration,
                       PetBonus petBonus)
        {
            Arcane = arcane;
            Fire = fire;
            Frost = frost;
            Holy = holy;
            Nature = nature;
            Shadow = shadow;
            ManaRegen = manaRegen;
            Hit = hit;
            Haste = haste;
            BonusHealing = bonusHealing;
            SpellPenetration = spellPenetration;
            PetBonus = petBonus;
        }

        public override string ToString()
        {
            return string.Format("{1}{0}" +
                                 "{2}{0}" +
                                 "{3}{0}" +
                                 "{4}{0}" +
                                 "{5}{0}" +
                                 "{6}{0}" +
                                 "{7}{0}" +
                                 "{8}{0}" +
                                 "Bonus Healing: {9}{0}" +
                                 "Spell Penetration: {10}{0}" +
                                 "{11}",
                                 Environment.NewLine,
                                 Arcane,
                                 Fire,
                                 Frost,
                                 Holy,
                                 Nature,
                                 Shadow,
                                 ManaRegen,
                                 Hit,
                                 BonusHealing,
                                 SpellPenetration,
                                 (PetBonus.AttackPower != -1) ? PetBonus + Environment.NewLine : "");
        }
    }
}
